#ifndef TRACE_H_
#define TRACE_H_
#define TRACEEXIT_SUCCESS	EXIT_SUCCESS
#define TRACEEXIT_WARNING	EXIT_WARNING
#define TRACEEXIT_ERROR		EXIT_ERROR
#define TRACEEXIT_FATAL		EXIT_FATAL
#define TRACEEXIT_END   	EXIT_END

#define	OPT_DECLARATION				0x00000001
#define	OPT_DECLARATOR				0x00000002
#define	OPT_STATEMENT				0x00000004
#define	OPT_EXPRESSION				0x00000008
#define OPT_INITEXPRLIST            0x00000010

#define ENTRY_TU 1
#define ENTRY_FUNC 2

#define EVENT_CMDLIST_PREV         0x10000001
#define EVENT_CONFLUX_STOP         0x10000002
#define EVENT_CONFLUX_CONTINUE     0x10000004
#define EVENT_CMDLIST_ENTRY_PREV   0x10000020
#define EVENT_CMDLIST_ENTRY_POST   0x10000040
#define EVENT_CMDLIST_EXIT_PREV   0x10000080
#define EVENT_CMDLIST_EXIT_POST   0x10000100
#define EVENT_PATH_PUSH  0x00000800
#define EVENT_PATH_POP   0x00001000
#define EVENT_LOOP_PUSH  0x00002000
#define EVENT_LOOP_POP   0x00004000

#define TROPT_CMDLIST_LOOP_ONCE   1
#define TROPT_CMDLIST_LOOP_TWICE  2
#define TROPT_CMDLIST_3_TIME      3
#define TROPT_CMDLIST_ONCELOOP_CHECKER_ON      4
#define TROPT_CMDLIST_ONCELOOP_CHECKER_OFF     5
#define TROPT_CMDLIST_RECORDER_ON         6
#define TROPT_CMDLIST_RECORDER_OFF        7
#define TROPT_CMDLIST_ENTER_CALLEE        8
#define TROPT_CMDLIST_SKIP_CALLEE         9
#ifdef DEBUG
S4 printCmdList( AST astCmdList, U4 event );
S4 printAllVariable( VOID );
VOID printAllCmdList(VOID);
#define LOG printCmdList
#else
#define printCmdList( astCmdList, event )
#define printAllVariable( VOID )
#define printAllCmdList(VOID)
#define LOG(...)
#endif
typedef S4	(*TRACE_AST_CALLBACK)( AST, U4 );
typedef AST (*CALLBACK_FUNCALL)( AST astExp, BOOL bFirstFlg );
/* Trace function prototype */
extern S4	TraceTranslationUnit( AST astObj, U4 ulOpt1, U4 ulEvent1,
		S4 (*pfunc1)(U2, AST, U4 ), CALLBACK_FUNCALL pGetFuncInfo  );
extern S4	TraceClose( VOID );
extern S4   TraceSetOpt ( PSZ pszOptKind, S4  iOptValue );


extern VOID TraceGetCurrObj( U2 *pu2Kind, AST * pastTable );
extern AST	TraceGetArg( AST astExp, S4 num );
extern AST TraceGetCurrStatement( VOID );
extern S4 TraceClearStack( U4 ulOpt1, U4 ulEvent1, S4	(*pfunc1)(U2, AST, U4 ), CALLBACK_FUNCALL pGetFuncInfo  );
extern VOID TraceSetCurrFuncFlg( U2 u2_Keyword, U2 u2_value );
extern U2 TraceGetCurrFuncFlg( U2 u2_Keyword );
extern S4 Tr_FuncSolvLoopConflux( AST astFunc, S4 (*pfunc1)( AST, U4 ) );

#endif /*TRACE_H_*/
